<?php
/*************************************************

消息通知模块主模型 - the
Author:  reload  <17-10-24>

*************************************************/
namespace Home\Model;
use Think\Model\RelationModel;
class MessageModel extends RelationModel {
    public function get_all($map,$field='*',$page=1,$pagenum=999999) {
        $data = $this->where($map)->limit(($page-1)*$pagenum,$pagenum)->field($field)->select();
        return $data;
    }


    public function get_one($map) {
        $data = $this->where($map)->find();
        return $data;
    }


    public function count($map) {
        $count = M('Message')->where($map)->count();
        return $count;
    }

    public function del_message($map) {
        $res = $this->where($map)->delete();
        return $res;
    }

    public function edit($map,$data) {
        $res = $this->where($map)->save($data);
        return $res;
    }

}